3.2.45 \(\int \csc (c+d x) (a+a \sin (c+d x))^n \, dx\) [145]

Optimal. Leaf size=85 \[ -\frac {2^{\frac {1}{2}+n} F_1\left (\frac {1}{2};1,\frac {1}{2}-n;\frac {3}{2};1-\sin (c+d x),\frac {1}{2} (1-\sin (c+d x))\right ) \cos (c+d x) (1+\sin (c+d x))^{-\frac {1}{2}-n} (a+a \sin (c+d x))^n}{d} \]

[Out]

-2^(1/2+n)*AppellF1(1/2,1,1/2-n,3/2,1-sin(d*x+c),1/2-1/2*sin(d*x+c))*cos(d*x+c)*(1+sin(d*x+c))^(-1/2-n)*(a+a*s
in(d*x+c))^n/d

________________________________________________________________________________________

Rubi [A]
time = 0.08, antiderivative size = 85, normalized size of antiderivative = 1.00, number of steps used = 4, number of rules used = 4, integrand size = 19, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.210, Rules used = {2866, 2864, 129, 440} \begin {gather*} -\frac {2^{n+\frac {1}{2}} \cos (c+d x) (\sin (c+d x)+1)^{-n-\frac {1}{2}} (a \sin (c+d x)+a)^n F_1\left (\frac {1}{2};1,\frac {1}{2}-n;\frac {3}{2};1-\sin (c+d x),\frac {1}{2} (1-\sin (c+d x))\right )}{d} \end {gather*}

Antiderivative was successfully verified.

[In]

Int[Csc[c + d*x]*(a + a*Sin[c + d*x])^n,x]

[Out]

-((2^(1/2 + n)*AppellF1[1/2, 1, 1/2 - n, 3/2, 1 - Sin[c + d*x], (1 - Sin[c + d*x])/2]*Cos[c + d*x]*(1 + Sin[c
+ d*x])^(-1/2 - n)*(a + a*Sin[c + d*x])^n)/d)

Rule 129

Int[((e_.)*(x_))^(p_)*((a_) + (b_.)*(x_))^(m_)*((c_) + (d_.)*(x_))^(n_), x_Symbol] :> With[{k = Denominator[p]
}, Dist[k/e, Subst[Int[x^(k*(p + 1) - 1)*(a + b*(x^k/e))^m*(c + d*(x^k/e))^n, x], x, (e*x)^(1/k)], x]] /; Free
Q[{a, b, c, d, e, m, n}, x] && NeQ[b*c - a*d, 0] && FractionQ[p] && IntegerQ[m]

Rule 440

Int[((a_) + (b_.)*(x_)^(n_))^(p_)*((c_) + (d_.)*(x_)^(n_))^(q_), x_Symbol] :> Simp[a^p*c^q*x*AppellF1[1/n, -p,
 -q, 1 + 1/n, (-b)*(x^n/a), (-d)*(x^n/c)], x] /; FreeQ[{a, b, c, d, n, p, q}, x] && NeQ[b*c - a*d, 0] && NeQ[n
, -1] && (IntegerQ[p] || GtQ[a, 0]) && (IntegerQ[q] || GtQ[c, 0])

Rule 2864

Int[((d_.)*sin[(e_.) + (f_.)*(x_)])^(n_)*((a_) + (b_.)*sin[(e_.) + (f_.)*(x_)])^(m_), x_Symbol] :> Dist[(-b)*(
d/b)^n*(Cos[e + f*x]/(f*Sqrt[a + b*Sin[e + f*x]]*Sqrt[a - b*Sin[e + f*x]])), Subst[Int[(a - x)^n*((2*a - x)^(m
 - 1/2)/Sqrt[x]), x], x, a - b*Sin[e + f*x]], x] /; FreeQ[{a, b, d, e, f, m, n}, x] && EqQ[a^2 - b^2, 0] &&  !
IntegerQ[m] && GtQ[a, 0] && GtQ[d/b, 0]

Rule 2866

Int[((d_.)*sin[(e_.) + (f_.)*(x_)])^(n_.)*((a_) + (b_.)*sin[(e_.) + (f_.)*(x_)])^(m_), x_Symbol] :> Dist[a^Int
Part[m]*((a + b*Sin[e + f*x])^FracPart[m]/(1 + (b/a)*Sin[e + f*x])^FracPart[m]), Int[(1 + (b/a)*Sin[e + f*x])^
m*(d*Sin[e + f*x])^n, x], x] /; FreeQ[{a, b, d, e, f, m, n}, x] && EqQ[a^2 - b^2, 0] &&  !IntegerQ[m] &&  !GtQ
[a, 0]

Rubi steps

\begin {align*} \int \csc (c+d x) (a+a \sin (c+d x))^n \, dx &=\left ((1+\sin (c+d x))^{-n} (a+a \sin (c+d x))^n\right ) \int \csc (c+d x) (1+\sin (c+d x))^n \, dx\\ &=-\frac {\left (\cos (c+d x) (1+\sin (c+d x))^{-\frac {1}{2}-n} (a+a \sin (c+d x))^n\right ) \text {Subst}\left (\int \frac {(2-x)^{-\frac {1}{2}+n}}{(1-x) \sqrt {x}} \, dx,x,1-\sin (c+d x)\right )}{d \sqrt {1-\sin (c+d x)}}\\ &=-\frac {\left (2 \cos (c+d x) (1+\sin (c+d x))^{-\frac {1}{2}-n} (a+a \sin (c+d x))^n\right ) \text {Subst}\left (\int \frac {\left (2-x^2\right )^{-\frac {1}{2}+n}}{1-x^2} \, dx,x,\sqrt {1-\sin (c+d x)}\right )}{d \sqrt {1-\sin (c+d x)}}\\ &=-\frac {2^{\frac {1}{2}+n} F_1\left (\frac {1}{2};1,\frac {1}{2}-n;\frac {3}{2};1-\sin (c+d x),\frac {1}{2} (1-\sin (c+d x))\right ) \cos (c+d x) (1+\sin (c+d x))^{-\frac {1}{2}-n} (a+a \sin (c+d x))^n}{d}\\ \end {align*}

________________________________________________________________________________________

Mathematica [C] Result contains complex when optimal does not.
time = 12.47, size = 2203, normalized size = 25.92 \begin {gather*} \text {Result too large to show} \end {gather*}

Warning: Unable to verify antiderivative.

[In]

Integrate[Csc[c + d*x]*(a + a*Sin[c + d*x])^n,x]

[Out]

-1/2*(Csc[c + d*x]*(a + a*Sin[c + d*x])^n*(AppellF1[2*n, n, n, 1 + 2*n, (-1 - I)/(-1 + Tan[(-c + Pi/2 - d*x)/2
]), (-1 + I)/(-1 + Tan[(-c + Pi/2 - d*x)/2])]*((-I + Tan[(-c + Pi/2 - d*x)/2])/(-1 + Tan[(-c + Pi/2 - d*x)/2])
)^n*((I + Tan[(-c + Pi/2 - d*x)/2])/(-1 + Tan[(-c + Pi/2 - d*x)/2]))^n - AppellF1[2*n, n, n, 1 + 2*n, (1 - I)/
(1 + Tan[(-c + Pi/2 - d*x)/2]), (1 + I)/(1 + Tan[(-c + Pi/2 - d*x)/2])]*((-I + Tan[(-c + Pi/2 - d*x)/2])/(1 +
Tan[(-c + Pi/2 - d*x)/2]))^n*((I + Tan[(-c + Pi/2 - d*x)/2])/(1 + Tan[(-c + Pi/2 - d*x)/2]))^n))/(d*(Sec[(-c +
 Pi/2 - d*x)/2]^2)^n*(-1/2*(n*Tan[(-c + Pi/2 - d*x)/2]*(AppellF1[2*n, n, n, 1 + 2*n, (-1 - I)/(-1 + Tan[(-c +
Pi/2 - d*x)/2]), (-1 + I)/(-1 + Tan[(-c + Pi/2 - d*x)/2])]*((-I + Tan[(-c + Pi/2 - d*x)/2])/(-1 + Tan[(-c + Pi
/2 - d*x)/2]))^n*((I + Tan[(-c + Pi/2 - d*x)/2])/(-1 + Tan[(-c + Pi/2 - d*x)/2]))^n - AppellF1[2*n, n, n, 1 +
2*n, (1 - I)/(1 + Tan[(-c + Pi/2 - d*x)/2]), (1 + I)/(1 + Tan[(-c + Pi/2 - d*x)/2])]*((-I + Tan[(-c + Pi/2 - d
*x)/2])/(1 + Tan[(-c + Pi/2 - d*x)/2]))^n*((I + Tan[(-c + Pi/2 - d*x)/2])/(1 + Tan[(-c + Pi/2 - d*x)/2]))^n))/
(Sec[(-c + Pi/2 - d*x)/2]^2)^n + ((1/4 + I/4)*Cos[(-c + Pi/2 - d*x)/2]^4*Csc[c + d*x]^2*(I*n*(1 + 2*n)*AppellF
1[2*n, n, n, 1 + 2*n, (1 - I)/(1 + Tan[(-c + Pi/2 - d*x)/2]), (1 + I)/(1 + Tan[(-c + Pi/2 - d*x)/2])]*Sec[(-c
+ Pi/2 - d*x)/2]^2*(-1 + Tan[(-c + Pi/2 - d*x)/2])^2*((-I + Tan[(-c + Pi/2 - d*x)/2])/(1 + Tan[(-c + Pi/2 - d*
x)/2]))^n*((I + Tan[(-c + Pi/2 - d*x)/2])/(1 + Tan[(-c + Pi/2 - d*x)/2]))^(-1 + n) - n*(1 + 2*n)*AppellF1[2*n,
 n, n, 1 + 2*n, (1 - I)/(1 + Tan[(-c + Pi/2 - d*x)/2]), (1 + I)/(1 + Tan[(-c + Pi/2 - d*x)/2])]*Sec[(-c + Pi/2
 - d*x)/2]^2*(-1 + Tan[(-c + Pi/2 - d*x)/2])^2*((-I + Tan[(-c + Pi/2 - d*x)/2])/(1 + Tan[(-c + Pi/2 - d*x)/2])
)^(-1 + n)*((I + Tan[(-c + Pi/2 - d*x)/2])/(1 + Tan[(-c + Pi/2 - d*x)/2]))^n + 2*n^2*(AppellF1[1 + 2*n, n, 1 +
 n, 2 + 2*n, (1 - I)/(1 + Tan[(-c + Pi/2 - d*x)/2]), (1 + I)/(1 + Tan[(-c + Pi/2 - d*x)/2])] - I*AppellF1[1 +
2*n, 1 + n, n, 2 + 2*n, (1 - I)/(1 + Tan[(-c + Pi/2 - d*x)/2]), (1 + I)/(1 + Tan[(-c + Pi/2 - d*x)/2])])*Sec[(
-c + Pi/2 - d*x)/2]^2*(-1 + Tan[(-c + Pi/2 - d*x)/2])^2*((-I + Tan[(-c + Pi/2 - d*x)/2])/(1 + Tan[(-c + Pi/2 -
 d*x)/2]))^n*((I + Tan[(-c + Pi/2 - d*x)/2])/(1 + Tan[(-c + Pi/2 - d*x)/2]))^n - n*(1 + 2*n)*AppellF1[2*n, n,
n, 1 + 2*n, (-1 - I)/(-1 + Tan[(-c + Pi/2 - d*x)/2]), (-1 + I)/(-1 + Tan[(-c + Pi/2 - d*x)/2])]*Sec[(-c + Pi/2
 - d*x)/2]^2*((-I + Tan[(-c + Pi/2 - d*x)/2])/(-1 + Tan[(-c + Pi/2 - d*x)/2]))^n*((I + Tan[(-c + Pi/2 - d*x)/2
])/(-1 + Tan[(-c + Pi/2 - d*x)/2]))^(-1 + n)*(1 + Tan[(-c + Pi/2 - d*x)/2])^2 + I*n*(1 + 2*n)*AppellF1[2*n, n,
 n, 1 + 2*n, (-1 - I)/(-1 + Tan[(-c + Pi/2 - d*x)/2]), (-1 + I)/(-1 + Tan[(-c + Pi/2 - d*x)/2])]*Sec[(-c + Pi/
2 - d*x)/2]^2*((-I + Tan[(-c + Pi/2 - d*x)/2])/(-1 + Tan[(-c + Pi/2 - d*x)/2]))^(-1 + n)*((I + Tan[(-c + Pi/2
- d*x)/2])/(-1 + Tan[(-c + Pi/2 - d*x)/2]))^n*(1 + Tan[(-c + Pi/2 - d*x)/2])^2 + 2*n^2*((-I)*AppellF1[1 + 2*n,
 n, 1 + n, 2*(1 + n), (-1 - I)/(-1 + Tan[(-c + Pi/2 - d*x)/2]), (-1 + I)/(-1 + Tan[(-c + Pi/2 - d*x)/2])] + Ap
pellF1[1 + 2*n, 1 + n, n, 2*(1 + n), (-1 - I)/(-1 + Tan[(-c + Pi/2 - d*x)/2]), (-1 + I)/(-1 + Tan[(-c + Pi/2 -
 d*x)/2])])*Sec[(-c + Pi/2 - d*x)/2]^2*((-I + Tan[(-c + Pi/2 - d*x)/2])/(-1 + Tan[(-c + Pi/2 - d*x)/2]))^n*((I
 + Tan[(-c + Pi/2 - d*x)/2])/(-1 + Tan[(-c + Pi/2 - d*x)/2]))^n*(1 + Tan[(-c + Pi/2 - d*x)/2])^2))/((1 + 2*n)*
(Sec[(-c + Pi/2 - d*x)/2]^2)^n)))

________________________________________________________________________________________

Maple [F]
time = 0.14, size = 0, normalized size = 0.00 \[\int \csc \left (d x +c \right ) \left (a +a \sin \left (d x +c \right )\right )^{n}\, dx\]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(csc(d*x+c)*(a+a*sin(d*x+c))^n,x)

[Out]

int(csc(d*x+c)*(a+a*sin(d*x+c))^n,x)

________________________________________________________________________________________

Maxima [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Failed to integrate} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(csc(d*x+c)*(a+a*sin(d*x+c))^n,x, algorithm="maxima")

[Out]

integrate((a*sin(d*x + c) + a)^n*csc(d*x + c), x)

________________________________________________________________________________________

Fricas [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {could not integrate} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(csc(d*x+c)*(a+a*sin(d*x+c))^n,x, algorithm="fricas")

[Out]

integral((a*sin(d*x + c) + a)^n*csc(d*x + c), x)

________________________________________________________________________________________

Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \int \left (a \left (\sin {\left (c + d x \right )} + 1\right )\right )^{n} \csc {\left (c + d x \right )}\, dx \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(csc(d*x+c)*(a+a*sin(d*x+c))**n,x)

[Out]

Integral((a*(sin(c + d*x) + 1))**n*csc(c + d*x), x)

________________________________________________________________________________________

Giac [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {could not integrate} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(csc(d*x+c)*(a+a*sin(d*x+c))^n,x, algorithm="giac")

[Out]

integrate((a*sin(d*x + c) + a)^n*csc(d*x + c), x)

________________________________________________________________________________________

Mupad [F]
time = 0.00, size = -1, normalized size = -0.01 \begin {gather*} \int \frac {{\left (a+a\,\sin \left (c+d\,x\right )\right )}^n}{\sin \left (c+d\,x\right )} \,d x \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((a + a*sin(c + d*x))^n/sin(c + d*x),x)

[Out]

int((a + a*sin(c + d*x))^n/sin(c + d*x), x)

________________________________________________________________________________________